package il.ac.tau.cg.ex3.utils.octree;

public class BoundingBox
{
	private double minX;
	private double maxX;
	private double minY;
	private double maxY;
	private double minZ;
	private double maxZ;
	
	public BoundingBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
	{
		this.minX = minX;
		this.maxX = maxX;
		this.minY = minY;
		this.maxY = maxY;
		this.minZ = minZ;
		this.maxZ = maxZ;
	}
	
	public double getMinX()
	{
		return minX;
	}

	public double getMaxX()
	{
		return maxX;
	}

	public double getMinY()
	{
		return minY;
	}

	public double getMaxY()
	{
		return maxY;
	}

	public double getMinZ()
	{
		return minZ;
	}

	public double getMaxZ()
	{
		return maxZ;
	}

	public boolean contains(BoundingBox other)
	{
		return (((minX <= other.minX) && (maxX >= other.maxX)) &&
				((minY <= other.minY) && (maxY >= other.maxY)) &&
				((minZ <= other.minZ) && (maxZ >= other.maxZ)));
	}
	
	@Override
	public BoundingBox clone()
	{
		return new BoundingBox(minX, maxX, minY, maxY, minZ, maxZ);
	}
}
